<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="author" content="order by dede58.com/"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <!-- CSRF Token -->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin.Laravel后台登录</title>
    <link rel="stylesheet" type="text/css" href="{{asset('static/admin/layui/css/layui.css')}}"/>
    <link rel="stylesheet" type="text/css" href="{{asset('static/admin/css/login.css')}}"/>
    <script src="{{ asset('js/jquery.min.js') }}" defer></script>
</head>

<body>
<div class="m-login-bg">
    <div class="m-login">
        <h3>Admin.Laravel后台系统登录</h3>
        <div class="m-login-warp">
            <form class="layui-form" action="/login" method="post">
                @csrf
                @include('layouts._flash')
                <div class="layui-form-item">
                    {!! Form::text('username','',['class'=>'layui-input','lay-verify'=>'required','placeholder'=>'用户名/邮箱/手机号','required']) !!}
                </div>
                <div class="layui-form-item">
                    {!! Form::password('password',['class'=>'layui-input','lay-verify'=>'required','placeholder'=>'密码','required']) !!}
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        {!! Form::text('captcha','',['class'=>'layui-input','lay-verify'=>'required','placeholder'=>'验证码','required']) !!}
                    </div>
                    <div class="layui-inline" style="float: right;">
                        <img class="verifyImg" onclick="this.src=this.src+'?c='+Math.random();"
                             src="{{captcha_src()}}"/>
                    </div>
                </div>
                <div class="layui-form-item m-login-btn">
                    <div class="layui-inline">
                        {!! Form::submit('登录',['class'=>'layui-btn layui-btn-normal','onclick'=>'sbm()','lay-filter'=>'login','lay-submit']); !!}
                    </div>
                    <div class="layui-inline">
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
        <p class="copyright">Copyright 2018-2019 by Admin.Laravel</p>
    </div>
</div>
<script src="{{asset('static/admin/layui/layui.js')}}" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form(),
            layer = layui.layer;
    });
    var tid;

    var bClicked = false;

    function sbm() {

        if (bClicked) {

            layer.msg('请不要重复点击', {icon: 5, time: 3000});

            return false;
        }

        bClicked = true;

        tid = setTimeout("doit()", 3000);
    }

    function doit() {

        if (tid != null) {
            clearTimeout(tid);
            tid = null;
        }

        bClicked = false;

    }
</script>
</body>

</html>
